SP Speak Text (voice; lines; first; last) -> err

voice          string (63) specifys the voice you want to use.
lines           text           is a text variable or field which contains the
                                   text you want to be spoken.
first           integer       specifys on which location to start reading.
last            integer       specifying on which location to stop reading.
                                   This is the position of the last character selected
                                    plus one!
err             integer       returns the error which occured. 
                                    A value of zero indicates no error occured. See 
                                    below for a list of possible errors.

Reads out the text you pass using the specified voice and starting and stopping on the specified locations, without returning to 4D until the lines have been spoken.

The ”first“ and ”last“ parameters work like the parameters used with the standard GET HIGHLIGHT and HIGHLIGHT TEXT 4D commands.
The specified selection of the text will be spoken and control will not return to 4D until speaking is finished. It is not possible to cancel. This function can still be used when the limit of speech channels opened by the SP Open Voice function has been reached.
If one of the ”first“ and ”last“ parameters is negative, zero or if they are equal the full text will be read to you. And, ofcourse, also when ”first“ is one and ”last“ is the length of the text plus one.

Examples:
  `these all have the same effect
  $err := SP Speak Text ("Marvin";[File 1]Description;0;0)
  $err := SP Speak Text ("Marvin";[File 1]Description;1;1)
  $err := SP Speak Text ("Marvin";[File 1]Description;1;33000)
  $err := SP Speak Text ("Marvin";[File 1]Description;1;
               Length([File 1]Description) + 1)

  `and this one will ignore the last character
  $err := SP Speak Text ("Marvin";[File 1]Description;1;
               Length([File 1]Description))

  `and this one will only say "Speech Manager"
  $lines := "Testing Speech Manager"
  $err := SP Speak Text ("Marvin";$lines;9;Length ($lines) + 1)

Possible errors:
        0  No Error
      -4  Speech Pack can not be used (Speech Mgr not available)
    -50  Parameter error (inside external, not necessarily the
            parameters you pass)
  -108  Not enough memory to load voice into memory

  -205  Bad channel, speaker volume is too low or Speech Pack disabled
  -241  Could not open another speech synthesizer channel
  -242  Voice synthesizer is not ready
  -244  Voice resource not found
  -247  Input text bad
-3000  Invalid SpeechChannel parameter, probably invalid reference
            number